package org.vergil.core.designpattern.state.Lift;

/**
 * Created by vergil on 17-3-25.
 */
public class OpenningState extends LiftState {

    public OpenningState(LiftState state){
        this.context = state.context;
    }

    @Override
    public void open() {
        context.setLiftState(Context.openningState);
        System.out.println("电梯门开启...");
    }

    @Override
    public void close() {
        //状态修改
        context.setLiftState(Context.closingState);
        context.getLiftState().close();
    }
    @Override
    public void run() {
        System.out.println("电梯门开启...不能运行");
    }

    @Override
    public void stop() {

    }
}
